{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "332126f9-3524-4223-bcc6-24b9818b77b5",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "from mythic import mythic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "abfa531f-5e7a-400b-910c-92a62106ccbe",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "mythic_instance = await mythic.login(\n",
    "        username=\"mythic_admin\",\n",
    "        password=\"mythic_password\",\n",
    "        server_ip=\"mythic_nginx\",\n",
    "        server_port=7443,\n",
    "        timeout=-1\n",
    "    )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fa3c9e18-12b3-4b88-9157-c1b920fc64c7",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "# ################ Subscribe to file browser data on host ################\n",
    "async for data in mythic.subscribe_all_filebrowser(mythic=mythic_instance, host=\"SPOOKY.LOCAL\"):\n",
    "    print(data)\n",
    "    break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "20f04a98-1f3a-449a-a7f4-86cd0ae77f21",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "# ################ Subscribe to all file browser data across all hosts ################\n",
    "async for data in mythic.subscribe_all_filebrowser(mythic=mythic_instance):\n",
    "    print(data)\n",
    "    break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a2c32aee-ff86-474b-a21a-b8af1862c247",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "# ################ Get file browser data on host ################\n",
    "async for data in mythic.get_all_filebrowser(mythic=mythic_instance, host=\"SPOOKY.LOCAL\", batch_size=10):\n",
    "    print(f\"Got data! {data}\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3ff8c88a-a157-4ed0-a5df-331ac9bd83bb",
   "metadata": {},
   "outputs": [],
   "source": [
    "# ################ Get file browser data on all hosts ################\n",
    "async for data in mythic.get_all_filebrowser(mythic=mythic_instance, batch_size=10):\n",
    "    print(f\"Got data! {data}\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7d18e44e-69a8-4b21-9ba0-365d32635adb",
   "metadata": {},
   "outputs": [],
   "source": [
    "# ################ Subscribe to new file browser data (optionally on a host) ################\n",
    "async for resp in mythic.subscribe_new_filebrowser(mythic=mythic_instance, batch_size=1, timeout=10):\n",
    "    print(resp)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
